import server from '@dt/server/dt'
import { userStore } from '@/store/user'
const api = {
  saMenuSave: server.api().post('/sa-admin/api/v1/saMenu/save'),
  saMenuDelete: server.api().post('/sa-admin/api/v1/saMenu/del'),
  saMenuUpdate: server.api().post('/sa-admin/api/v1/saMenu/update')
}

function saMenuSave(info) {
  let params = {
    ...info,
    operatorId: userStore().info.userId
  }
  return api.saMenuSave.fetch(params)
}

function saMenuDelete(info) {
  let params = {
    ...info,
    operatorId: userStore().info.userId
  }

  return api.saMenuDelete.fetch(params)
}

function saMenuUpdate(info) {
  let params = {
    ...info,
    operatorId: userStore().info.userId
  }

  return api.saMenuUpdate.fetch(params)
}

export default {
  saMenuSave,
  saMenuDelete,
  saMenuUpdate
}
